<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    #outer{
      width: 400px;
      height: 400px;
      background-color: gray;
      overflow: hidden;
    }
    #inner{
      width: 200px;
      height: 100px;
      background-color: red;
      /*margin-left:  100px;*/
      /*margin-right:  100px;*/
      margin: 0 auto;
      margin-top: 150px;
      margin-bottom: 150px;
    }
  </style>
</head>
<body>
<div id="outer">
  <div id="inner">inner</div>
</div>
</body>
</html>